package iterator;

public class IteratorMain {
    public static void main(String[] args) {
        BookShelf bookShelf = new BookShelf();

        bookShelf.append(new Book(1, "基督山伯爵"));
        bookShelf.append(new Book(2, "圣经"));

        Iterator<Book> iterator = bookShelf.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
